﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Documents;

namespace NewWms.Extend
{
   public static class GlobalVariable
    {
         static GlobalVariable()
        {
            GetEnvironment();
        }
        public static string Machine {  get; set; }
        public static string Config { get; set; }
        public static string InletCode { get; set; }//输送线入库口  仓库出口
        public static string OutletCode {  get; set; }//输送线出库口  仓库入口
        public static string IsDebug {  get; set; }
        public static string EssIp {  get; set; }//ess 接口ip地址
        public static string CustomIp { get; set; } //客户ip地址
        public static string slotCode {  get; set; }//容器流动方向
        public static void GetEnvironment()
        {
            EssIp = ConfigurationManager.AppSettings["EssIp"];// "10.163.130.100:9046";
            CustomIp = ConfigurationManager.AppSettings["CustomIp"];//"10.163.130.172";
            Machine = ConfigurationManager.AppSettings["Machine"];//Environment.GetEnvironmentVariable("Machine", EnvironmentVariableTarget.Machine);
            Config = ConfigurationManager.ConnectionStrings["WebApiConfig"].ConnectionString; //Environment.GetEnvironmentVariable("常州贸联-config", EnvironmentVariableTarget.Machine);
            IsDebug = ConfigurationManager.AppSettings["IsDebug"];//Environment.GetEnvironmentVariable("IsDebug", EnvironmentVariableTarget.Machine);
            if (Machine == "1")
            {
                InletCode = "LT_CONVEYOR_INPUT:POINT:6930:8103";
                OutletCode = "LT_CONVEYOR_OUTPUT:POINT:6930:3903";
                slotCode = "1-4";
            }
            if(Machine == "2")
            {
                InletCode = "LT_CONVEYOR_INPUT:POINT:6930:8103";
                OutletCode = "LT_CONVEYOR_OUTPUT:POINT:6930:3903";
                slotCode = "1-5"; 
            }

        }
   
    }
}
